<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools"/>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">
    <t:datagrid name="platformList" title="" actionUrl="platformController.do?datagrid" idField="platformId" fit="true" queryMode="group" >
      <t:dgCol title="主键" field="platformId" hidden="true"></t:dgCol>
      <t:dgCol title="平台名称" field="name" query="true" width="1"></t:dgCol>
      <t:dgCol title="平台编码" field="platformCode"  width="1" query="true"></t:dgCol>
      <t:dgCol title="平台key" field="platformkey"  width="2"></t:dgCol>
      <t:dgCol title="平台密钥" field="platformSecret"  width="2"></t:dgCol>
      <t:dgCol title="是否开通" field="open" dictionary="isno"  width="1" query="true"></t:dgCol>
      <t:dgCol title="创建时间" formatter="yyyy-MM-dd hh:mm:ss" field="createTime" ></t:dgCol>

      <t:dgCol title="common.operation" field="opt" width="1"></t:dgCol>
      <t:dgConfOpt exp="open#eq#1" url="platformController.do?stop_or_start&platformId={platformId}" title="禁用" message="是否禁用此平台？"></t:dgConfOpt>
      <t:dgConfOpt exp="open#eq#0" url="platformController.do?stop_or_start&platformId={platformId}" title="开通" message="是否开通此平台？"></t:dgConfOpt>
      <%--<t:dgDelOpt url="platformController.do?del&platformId={platformId}" title="删除"></t:dgDelOpt>--%>

      <t:dgToolBar title="新增" icon="icon-add" url="platformController.do?addorupdate" funname="add"  width="600" height="300"></t:dgToolBar>
      <t:dgToolBar title="修改" icon="icon-edit" url="platformController.do?addorupdate" funname="f_updateInfo"  width="600" height="300"></t:dgToolBar>

    </t:datagrid>
  </div>
</div>
<script type="text/javascript">
  function f_updateInfo(title, url, id, width, height) {
    var rowsData = $('#'+id).datagrid('getSelections');
    if (!rowsData || rowsData.length==0) {
      tip('请选择分平台');
      return;
    }
    if (rowsData.length>1) {
      tip('请选择一条分平台再编辑');
      return;
    }
    url += '&platformId='+rowsData[0].platformId;
    createwindow(title, url, width, height);
  }
</script>
